import { clamp } from "cc";
import { LevelDataTmp } from "../SystemStorage/StorageTemp"
import { TrapCfg } from "./GlobalConfig";
import { GlobalEnum } from "./GlobalEnum"

/**资源分包路径配置 */
export const AssetsPkgCfg = {
    //场景Bound
    Scene: {

    }
}
//随机关卡数据
export const GetRandomLvData = (lv: number) => {

    const turnL = ['P002L', 'P003L', 'P004L'];  //竖直向左
    const turnR = ['P002R', 'P003R', 'P004R'];  //竖直向右

    const turnLB = ['P002LB', 'P003LB', 'P004LB'];   //左下
    const turnRB = ['P002RB', 'P003RB', 'P004RB'];   //右下

    const lineB = ['P001', 'P003'];   //竖直向下
    const lineL = ['P001L'];   //水平向左
    const lineR = ['P001R'];   //水平向右   

    //--------------路段--------------

    //---1.随机转折组合数量
    let turnMin = 1;
    let turnMax = 3;

    //---2.转折插入直线数量
    let insertMin = 2;
    let insertMax = 4;

    let turnArr: string[][] = [];
    let n = Math.floor(Math.random() * (turnMax - turnMin + 1)) + turnMin;

    for (let i = 0; i < n; i++) {
        //随机转折+2
        turnArr[i] = [];
        let isLeft = Math.random() > 0.5;
        const turnD1 = isLeft ? turnL : turnR;
        const turnD2 = isLeft ? turnLB : turnRB;
        let p1 = turnD1[Math.floor(Math.random() * turnD1.length)];
        let p2 = turnD2[Math.floor(Math.random() * turnD2.length)];
        //随机直线;
        let p3 = isLeft ? lineL[0] : lineR[0];
        let count = Math.floor(Math.random() * (insertMax - insertMin + 1)) + insertMin;

        //组合
        turnArr[i].push(p1);
        for (let m = 0; m < count; m++) {
            turnArr[i].push(p3);
        }
        turnArr[i].push(p2);
    }


    let data: LevelDataTmp = new LevelDataTmp();

    data.lv = lv;
    //起点
    data.path.push('P000');

    //---3.转折组合之间的直线插入
    let insert2Min = 1;
    let insert2Max = 3;

    for (let k = 0; k < turnArr.length; k++) {
        //插入 竖直向下
        //随机数量1~3
        let lCount = Math.floor(Math.random() * (insert2Max - insert2Min + 1)) + insert2Min;
        for (let l = 0; l < lCount; l++) {
            const p = lineB[Math.floor(Math.random() * lineB.length)];
            data.path.push(p);
        }

        const arr = turnArr[k];
        //插入转折
        for (let j = 0; j < arr.length; j++) {
            data.path.push(arr[j]);
        }
    }

    //终点
    data.path.push('P999');
    console.log('路段数量: ', data.path.length);


    //--------------敌人--------------   
    //生成点 
    let borRec = {
        'P000': '0',
        'P999': '0',
        'P001': '0',
        'P002': '0',
        'P003': '012',
        'P004': '01',
    }
    //特殊类型
    let _typeArr = [1, 2, 3, 4];

    //第一路段
    let fNumRate = 1;
    let fMin1 = 50;
    let fMax1 = 60;
    //中间路段
    let midNumRate = 1;
    let midMin = 30;
    let midMax = 40;
    //终点前一个路段
    let endNumRate = 1;
    let endMin = 60;
    let endMax = 70;
    //
    let pathStr = '0';
    let enemyNum = 0;
    let enemyType = 0;
    let enemyMin = 0;
    let enemyMax = 0;
    for (let i = 0; i < data.path.length; i++) {
        const p = data.path[i];

        //数量
        if (i == 0) {
            enemyNum = Math.floor(lv * fNumRate);
            enemyMin = enemyNum + fMin1;
            enemyMax = enemyNum + fMax1;
        } else if (i == data.path.length - 2) {
            enemyNum = Math.floor(lv * endNumRate);
            enemyMin = enemyNum + endMin;
            enemyMax = enemyNum + endMax;
        } else {
            enemyNum = Math.floor(lv * midNumRate);
            enemyMin = enemyNum + midMin;
            enemyMax = enemyNum + midMax;
        }

        //触发点
        let str = p.slice(0, 4);
        let pathArr = borRec[str];
        let strLen = Math.floor(Math.random() * pathArr.length) + 1;
        strLen = clamp(strLen, 1, 3);
        pathStr = pathArr.slice(0, strLen);

        //类型
        //普通类型
        enemyType = 0;
        let data1 = pathStr + ',' + enemyType + ',' + enemyMin + ',' + enemyMax;

        //特殊类型
        enemyType = _typeArr[Math.floor(Math.random() * _typeArr.length)];
        enemyMin = enemyMax = Math.ceil(lv / 5);
        let data2 = pathStr + ',' + enemyType + ',' + enemyMin + ',' + enemyMax;
        data.enemy.push([data1, data2]);
    }

    //---------------------道具-------------------------
    let propArr = [0, 1, 2];

    let rate = 0.95;
    let propMin = 1;
    let propMax = 3;
    let propNum = 0;

    for (let i = 0; i < data.path.length; i++) {
        const p = data.path[i];
        //弯道不放置道具
        if (turnLB.indexOf(p) >= 0 || turnRB.indexOf(p) >= 0 ||
            p == 'P000' || p == 'P999') {
            data.prop.push(null);
        } else {
            //90% 出现道具
            if (Math.random() > rate) {
                data.prop.push(null);
            } else {
                propNum = Math.floor(Math.random() * (propMax - propMin + 1)) + propMin;
                //道具类型
                let type = 0;
                let _rate = Math.random();
                if (_rate < 0.45) {
                    type = 2;
                } else if (_rate < 0.8) {
                    type = 1;
                } else {
                    type = 0;
                }

                switch (type) {
                    //武器
                    case 0:
                        let weaponArr = [1, 2, 3, 4, 5]; //武器类型id
                        let wpStr = '';
                        for (let n = 0; n < propNum; n++) {
                            let _wid = Math.floor(Math.random() * weaponArr.length);
                            wpStr += weaponArr[_wid];
                            weaponArr.splice(_wid, 1);
                        }
                        data.prop.push([0, 0, 0, wpStr]);
                        break;
                    //陷阱
                    case 1:
                        let trapArr = [0, 1, 2, 3, 4, 5]; //陷阱类型id
                        let trapType = trapArr[Math.floor(Math.random() * trapArr.length)]
                        let trapNum = TrapCfg[trapType].isMuilty ? propNum : 1;
                        let param = 0;

                        switch (trapType) {
                            //圆形电锯
                            case 0:
                                param = Math.random() > 0.5 ? 0 : 1;
                                break;
                            //地刺
                            case 0:
                                param = Math.random() > 0.5 ? 2 : 1;
                                break;
                            //锤子
                            case 0:
                                param = Math.random() > 0.5 ? 2 : 1;
                                break;
                            default:
                                //其他
                                break;
                        }

                        data.prop.push([1, trapType, trapNum, param]);
                        break;
                    //人数--最少出现3个
                    case 2:
                        let _snum = Math.floor(Math.random() * 1.9) + 1;
                        let _param = _snum == 1 && Math.random() > 0.5 ? 1 : 0;
                        let _symbArr = [];
                        for (let k = 0; k < _snum; k++) {
                            let _symRate = Math.random();
                            let _symb, _num;
                            if (_symRate <= 0.1) {
                                _symb = '/';
                                //2-3
                                _num = Math.floor(Math.random() * 3) + 2;
                            } else if (_symRate <= 0.3) {
                                _symb = '-';
                                //2-20
                                _num = Math.floor(Math.random() * 19) + 2;
                            } else if (_symRate <= 0.6) {
                                _symb = 'x';
                                //2-5
                                _num = Math.floor(Math.random() * 5) + 2;
                            } else {
                                _symb = '+';
                                //2-25
                                _num = Math.floor(Math.random() * 24) + 2;
                            }
                            _symbArr.push(_symb + _num);
                        }
                        data.prop.push([2, _symbArr[0], _symbArr[1] || null, _param]);
                        break;
                    default:
                        break;
                }
            }
        }

    }

    console.log('------------随机关卡数据---------(lv: ', lv, ' )-------')
    // console.log(JSON.stringify(data));
    return data;
}


/**
 * -------------路段---
 * 
 * P000 起点 - 刷新点:0
 * P999 终点 - 刷新点:0
 * 
 * P001 竖直向下 刷新点:0
 * P001R 水平向右 刷新点:0
 * P001L 水平向左 刷新点:0
 * 
 * P002R 竖直向右拐 - 刷新点:0
 * P002L 竖直向左拐 - 刷新点:0
 * P002RB 水平右方向下拐 - 刷新点:0
 * P002LB 水平左方向下拐 - 刷新点:0
 * 
 * P003   十字形 竖直向下   - 刷新点:012 //上右左
 * P003R  十字形 竖直向右拐 - 刷新点:012 //上左下
 * P003RB 十字形 右方向下拐 - 刷新点:012 //左上右
 * P003L  十字形 竖直向左拐 - 刷新点:012 //上右下
 * P003LB 十字形 左方向下拐 - 刷新点:012 //右上左
 * 
 * P004R 三叉 竖直向右  - 刷新点:01  //上下
 * P004L 三叉 竖直向左  - 刷新点:01  //上下
 * P004RB 三叉 右方向下 - 刷新点:01  //右左
 * P004LB 三叉 左方向下 - 刷新点:01  //右左
 */

/**
 * -----------敌人---------------
 * 敌人类型 : ['触发点Id, 敌人类型id, 最小数量, 最大数量 ']
 *  Normal = 0,     //普通兵        
 *  Bomb = 1,       //炸弹
 *  Ninja = 2,      //刺客
 *  Giant =3,       //巨人
 *  Boss = 4,       //Boss    
 * 
 */


/**
 * -----------道具---------------
 * <道具分类>: 0-武器,1-陷阱,2-人数,
 * 
 * (示例:[0, 0, 0,'12'] )
 * 武器类型-0: 第4个参数 (字符串 表示多个武器类型: '0','012' ... )
 * 0-手枪
 * 1-短枪
 * 2-喷火枪
 * 3-机关枪
 * 4-手榴弹
 * 5-无人机
 * 
 * (示例:[1,0,1,0])
 * 陷阱类型-1:- 第4个参数
 * 0-圆形电锯 参数: (数字:0-静态 1-动态) -固定一个位置只创建一个
 * 1-地刺    参数: (数字: 1-靠左,2-靠右)  -固定一个位置只创建一个
 * 2-锤子    参数: (数字: 1-靠左,2-靠右)  -固定一个位置只创建一个
 * 3-导弹    参数: 0
 * 4-炮台    参数: 0
 * 5-高空钉  参数: 0
 * 6-地雷    参数: 0
 * 
 * (示例:[2,'x1','+2',0],[2, 'x1', null, 0] )
 * 人数符号类型-2:  (符号 + - x / )
 * 第2个参数 左边数字
 * 第3个参数 右边数字
 * 第4个参数  (只有一个时生效:0-静止 1-左右移动,)
 */

/**
 * 关卡配置数据
 */
 export const LevelConfig: { [lv: number]: LevelDataTmp } = {
    //关卡
    1: {
        //关卡
        lv: 1,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P999'],
        // path: ['P000',  'P999'],

        //敌人
        // ['触发点Id, 敌人类型id, 最小数量, 最大数量 ']
        enemy: [
            ['0,0,35,35'],
            ['0,0,20,20'],
            ['0,0,20,30'],
            ['0,0,20,25'],
            ['0,0,30,45'],
            ['0,0,45,45'],
            ['0,0,40,45'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            null,
            [2, 'x5', '+10', 0],
            [1, 0, 1, 0],
            [0, 0, 0, '3'],
            [2, 'x3', '+20', 0],
            [1, 2, 1, 2],
            null
        ],
    },
    2: {
        //关卡
        lv: 2,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P999',],
        // path: ['P000',  'P999'],

        //敌人
        // ['触发点Id, 敌人类型id, 最小数量, 最大数量 ']
        enemy: [
            ['0,0,50,50'],
            ['0,0,30,30'],
            ['0,0,30,30'],
            ['0,0,30,35'],
            ['0,0,30,45'],
            ['0,0,50,50'],
            ['0,0,45,45'],
            ['0,0,40,45'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            null,
            [2, 'x6', 'x4', 0],
            [1, 0, 1, 0],
            [2, '+12', '+6', 0],
            [0, 0, 0, '3'],
            [1, 0, 1, 1],
            [2, 'x3', '+10', 0],
            [1, 2, 1, 1],
            [1, 2, 1, 2],
            null,
        ],
    },
    3: {
        //关卡
        lv: 3,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P004R', 'P001R', 'P003RB', 'P999',],
 

        //敌人
        // ['触发点Id, 敌人类型id, 最小数量, 最大数量 ']
        enemy: [
            ['012,0,45,55', '012,4,2,2'],
            ['012,0,35,35'],
            ['012,0,35,35', '012,4,1,1'],
            ['012,0,35,35'],
            ['012,0,30,35', '012,4,1,1'],
            ['012,0,30,35'],
            ['012,0,30,35', '012,4,1,1'],
            ['012,0,30,35'],
            ['012,0,35,35'],
            ['012,0,40,45', '012,4,2,2'],
            ['012,0,55,55'],
            ['012,0,60,65', '012,4,2,2'],
            ['012,0,45,45'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [0, 0, 0, '3'], // 需改人数配置  左2
            [2, '-3', '+10', 0],
            [1, 0, 1, 0],
            [2, 'x1', '-5', 0],
            [1, 0, 1, 1], //改圆柱
            [2, '+10', '+15', 0],
            [2, '+4', '+5', 0],// 需改人数配置  左4 右4
            [0, 0, 0, '5'],
            [1, 0, 1, 1],
            null,
            [2, 'x2', '+15', 0],
            [1, 0, 1, 1], //改移动圆柱
            null,
        ],
    },
    4: {
        //关卡
        lv: 4,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P002R', 'P001R', 'P001R', 'P001R', 'P003RB', 'P001', 'P999',],
        // path: ['P000',  'P999'],

        //敌人
        /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
        enemy: [
            ['012,0,55,55', '012,4,1,2'],
            ['012,0,45,45'],
            ['012,0,35,35', '012,4,2,3'],
            ['012,0,35,35'],
            ['012,0,30,35', '012,3,2,2'],
            ['012,0,30,35'],
            ['012,0,50,55', '012,4,2,3'],
            ['012,0,50,55'],
            ['012,0,65,65', '012,4,4,5'],
            ['012,0,60,65'],
            ['012,0,65,65', '012,4,4,5', '012,1,1,1'],
            ['012,0,60,75'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [2, 'x2', 'x4', 0],
            [1, 0, 1, 1], //改移动圆柱
            [2, '+5', '-10', 0],
            [0, 0, 0, '23'],
            [1, 0, 1, 1], //改圆柱
            null,
            [2, '+10', '+20', 0],
            [1, 0, 1, 0], //改圆柱
            [2, '-10', '+10', 0],
            [2, '-5', 0, 0],//改白人2个
            [1, 0, 1, 1],
            null,
        ],
    },
    5: {
        //关卡
        lv: 5,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P004L', 'P001L', 'P001L', 'P004LB', 'P001', 'P001', 'P999',],
        // path: ['P000',  'P999'],

        //敌人
        /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
        enemy: [
            ['012,0,65,75', '012,3,3,3'],
            ['012,0,55,55'],
            ['012,0,35,35', '012,3,4,4'],
            ['012,0,35,35'],
            ['012,0,30,35', '012,3,4,6'],
            ['012,0,30,35'],
            ['012,0,30,35', '012,3,4,4'],
            ['012,0,30,35'],
            ['012,0,55,65', '012,3,4,4'],
            ['012,0,50,55'],
            ['012,0,65,65', '012,1,4,4'],
            ['012,0,70,75'],
            null,
        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [2, '+3', 'x3', 0],
            [2, 0, '+6', 0], //改白人中间6个
            [1, 0, 1, 1], //改左右圆柱2个
            [0, 0, 0, '1'],
            null,
            [1, 0, 1, 1],
            [2, '+25', '-15', 0],
            [1, 3, 1, 0],
            [2, '-5', '-10', 0],
            [0, 0, 0, '4'],
            null,
        ],
    },
    6: {
        //关卡
        lv: 6,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P004L', 'P001L', 'P001L', 'P001L', 'P004LB', 'P001', 'P001', 'P999',],
        // path: ['P000',  'P999'],

        //敌人
        /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
        enemy: [
            ['012,0,65,65', '012,3,3,3'],
            ['012,0,55,55'],
            ['012,0,35,35', '012,3,4,4'],
            ['012,0,35,35'],
            ['012,0,30,35', '012,3,7,7'],
            ['012,0,40,45'],
            ['012,0,30,45', '012,3,4,4'],
            ['012,0,30,35'],
            ['012,0,55,55', '012,3,4,4'],
            ['012,0,50,65'],
            ['012,0,55,65', '012,1,4,4'],
            ['012,0,70,75'],
            ['012,0,75,75'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [2, 0, '+3', 0],
            [2, 'x2', '+6', 0], //改白人中间9个
            [1, 3, 1, 0], //改圆柱1个
            [0, 0, 0, '12'],
            [1, 0, 1, 1],
            null,
            [1, 0, 1, 0],
            [2, '+5', '+15', 0],
            [1, 3, 1, 2],
            null,
            [2, '+20', '+15', 0],
            [1, 3, 1, 0], //改圆柱1个
            null,
        ],
    },
    7:
    {
        lv: 7,
        path: ["P000", "P001", "P003", "P003", "P003L", "P001L", "P001L", "P002LB", "P001", "P002R", "P001R", "P001R", "P002RB", "P999"],
        enemy: [
            ["0,0,58,68", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["01,0,38,48", "01,1,2,2"],
            ["012,0,38,48", "012,3,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["0,0,38,48", "0,1,2,2"],
            ["0,0,38,48", "0,1,2,2"],
            ["0,0,38,48"],
            ["0,0,58,58", "0,1,3,3"],
            ["0,0,68,68", "0,2,2,3"],
            ["0,0,68,78", "0,1,5,5"],
        ],
        prop: [
            null,
            [2, "x4", "x2", 0],
            [1, 2, 1, 1],
            [2, "x2", "+25", 0],
            [0, 0, 0, "453"],
            [1, 1, 1, 1],
            [2, "+14", "-20", 0],
            [0, 0, 0, "234"],
            [2, "-17", "x3", 0],
            null,
            [1, 6, 3, 0],
            [0, 0, 0, "52"],
            [2, "-11", "+15", 0],
            [1, 3, 3, 0],
        ]
    },
    8:
    {
        lv: 8,
        path: ["P000", "P001", "P003", "P004L", "P001L", "P001L", "P003LB", "P003", "P003", "P003", "P004R", "P001R", "P001R", "P001R", "P003RB", "P999"],
        enemy: [
            ["0,0,58,68", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["01,0,38,48", "0,4,2,2"],
            ["01,0,38,48", "01,1,2,2"],
            ["012,0,38,48", "012,3,2,2"],
            ["012,0,38,48", "0,4,2,2"],
            ["012,0,38,48", "0,4,2,2"],
            ["012,0,38,48", "0,1,2,2"],
            ["012,0,38,48", "0,1,2,2"],
            ["012,0,38,48"],
            ["012,0,38,48", "0,4,2,2"],
            ["012,0,38,48", "0,4,2,2"],
            ["012,0,48,58", "0,1,3,3"],
            ["01,0,68,68", "0,2,2,3"],
            ["01,0,68,78", "0,1,5,5"],
            ["01,0,58,68", "0,4,2,2"]
        ],
        prop: [
            null,
            [2, "x2", "+15", 0],
            [0, 0, 0, "325"],
            [1, 2, 1, 1],
            [2, "-10", "x2", 0],
            [1, 3, 2, 1],
            [2, "+15", "-10", 0],
            null,
            [1, 2, 1, 1],
            [2, "x2", "+25", 0],
            [0, 0, 0, "524"],
            [2, "-10", "+15", 0],
            null,
            null
        ]
    },
    9: {
        //关卡
        lv: 9,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P004L', 'P001L', 'P001L', 'P001L', 'P004LB', 'P001', 'P001', 'P999',],
        // path: ['P000',  'P999'],

        //敌人
        /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
        enemy: [
            ['012,0,75,75', '012,3,3,3'],
            ['012,0,65,65'],
            ['012,0,45,45', '012,3,4,4'],
            ['012,0,45,45'],
            ['012,0,40,45', '012,3,5,5'],
            ['012,0,50,55'],
            ['012,0,40,55', '012,3,4,4'],
            ['012,0,50,55'],
            ['012,0,45,45', '012,1,2,2'],
            ['012,0,60,65'],
            ['012,0,65,65', '012,1,4,4'],
            ['012,0,60,75', '012,1,4,4'],
            ['012,0,65,75', '012,1,5,5'],
            ['012,0,75,75', '012,1,2,2'],
        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [2, 'x2', '+9', 0],
            [1, 0, 1, 1],
            [0, 0, 0, '12'],
            [2, '+12', 'x2', 0],
            [1, 0, 1, 1],
            null,
            [1, 0, 1, 0],
            [2, '+5', '+15', 0],
            [1, 3, 1, 0],
            [0, 0, 0, '234'],
            null,
            [2, '+25', '+15', 0],
            [1, 5, 1, 0], //改圆柱1个
            null,
        ],
    },
    10:
    {
        lv: 10,
        path: ["P000", "P003", "P003", "P001", "P004L", "P001L", "P001L", "P001L", "P002LB", "P001", "P003L", "P001L", "P001L", "P004LB", "P999"],
        enemy: [
            ["0,0,58,68", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["01,0,38,48", "01,1,2,2"],
            null,
            ["012,0,28,58", "012,3,2,2"],
            ["0,0,48,48", "0,2,2,2"],
            ["0,0,48,48", "0,4,5,5"],
            ["0,0,48,48", "0,2,4,4"],
            ["0,0,48,48", "0,1,5,5"],
            ["0,0,38,48"],
            ["0,0,48,48", "0,2,5,5"],
            ["0,0,58,68", "0,4,4,5"],
            ["0,0,58,58", "0,1,3,5"],
            ["0,0,58,58", "0,2,2,6"],
            ["0,0,68,68", "0,1,5,6"],
            ["0,0,50,50", "0,4,2,6"]
        ],
        prop: [
            null,
            [2, "x3", "+15", 0],
            [1, 2, 1, 1],
            [0, 0, 0, "324"],
            [2, "+10", "x2", 0],
            [1, 3, 2, 1],
            [2, "-5", "+10", 0],
            null,
            [1, 2, 1, 1],
            [2, "x2", "+25", 0],
            [0, 0, 0, "214"],
            [2, "-10", "+15", 0],
            [1, 3, 1, 1],
            [2, "-5", "+5", 0],
        ]
    },
    11: {
        //关卡
        lv: 11,
        //路段配置
        path: ["P000", "P001", "P003", "P002L", "P001L", "P001L", "P001L", "P003LB", "P001", "P004R", "P001R", "P001R", "P001R", "P004RB", "P999"],
        // path: ['P000',  'P999'],

        //敌人
        /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
        enemy: [
            ['012,0,55,55', '012,4,1,2'],
            ['012,0,45,45'],
            ['01,0,20,25', '01,4,2,3'],
            ['01,0,35,35'],
            ['012,0,30,35', '012,3,2,5'],
            ['012,0,30,45'],
            ['012,0,35,55', '012,4,3,5'],
            ['02,0,30,35'],
            ['01,0,45,55', '012,4,5,5'],
            ['01,0,40,45'],
            ['01,0,40,40', '012,4,6,6', '012,1,2,2'],
            ['01,0,50,50'],
            ['01,0,65,65', '01,4,4,5'],
            ['01,0,65,65', '01,4,4,5', '012,1,2,2'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [2, '+15', 'x3', 0],
            [1, 0, 1, 1], //改移动圆柱
            [2, '+10', '+15', 0],
            null,
            [0, 0, 0, '23'],
            [2, '-10', '+10', 0],
            [0, 0, 0, '23'],
            [1, 1, 1, 1], //改圆柱
            null,
            [2, '-2', '-5', 0],
            [1, 0, 1, 0], //改圆柱
            [2, '-10', '+10', 0],
            [2, '-5', 0, 0],//改白人2个
            [1, 0, 1, 1],
            null,
        ],
    },
    12:
    {
        lv: 12,
        path: ["P000", "P003", "P003", "P001", "P004L", "P001L", "P001L", "P001L", "P002LB", "P001", "P003L", "P001L", "P001L", "P004LB", "P999"],
        enemy: [
            ["0,0,68,68", "0,4,2,2"],
            ["0,0,48,48", "0,4,2,2"],
            ["0,0,48,48", "0,4,2,2"],
            ["01,0,48,48", "01,1,2,2"],
            null,
            ["012,0,38,48", "012,3,2,2"],
            ["0,0,48,48", "0,2,2,2"],
            ["0,0,58,68", "0,4,5,5"],
            ["0,0,58,58", "0,2,4,4"],
            ["0,0,48,58", "0,1,5,5"],
            ["0,0,48,58"],
            ["0,0,48,48", "0,2,5,5"],
            ["0,0,58,68", "0,4,4,5"],
            ["0,0,58,58", "0,1,3,5"],
            ["0,0,58,58", "0,2,2,6"],
            ["0,0,68,68", "0,1,5,6"],
            ["0,0,50,50", "0,4,2,6"]
        ],
        prop: [
            null,
            [2, "x3", "+15", 0],
            [1, 2, 1, 1],
            [1, 2, 1, 1],
            [2, "x2", "+25", 0],
            [0, 0, 0, "214"],
            [2, "+10", "x2", 0],
            [1, 3, 2, 1],
            [2, "-5", "+10", 0],
            null,
            [2, "-10", "+15", 0],
            [1, 3, 1, 1],
            [2, "-5", "+5", 0],
            [0, 0, 0, "324"],
        ]
    },
    13:
    {
        lv: 13,
        path: ["P000", "P001", "P003", "P004L", "P001L", "P001L", "P003LB", "P003", "P003", "P003", "P004R", "P001R", "P001R", "P001R", "P003RB", "P999"],
        enemy: [
            ["0,0,58,68", "0,4,2,2"],
            ["0,0,48,48", "0,4,2,2"],
            ["01,0,48,48", "0,4,2,2"],
            ["01,0,48,48", "01,1,2,2"],
            ["012,0,48,48", "012,3,2,2"],
            ["012,0,48,48", "0,4,2,2"],
            ["012,0,48,48", "0,4,2,2"],
            ["012,0,38,48", "0,1,2,2"],
            ["012,0,48,48", "0,1,2,2"],
            ["012,0,48,48"],
            ["012,0,38,48", "0,4,2,2"],
            ["012,0,48,48", "0,4,2,2"],
            ["012,0,48,58", "0,1,3,3"],
            ["01,0,88,88", "0,2,2,3"],
            ["01,0,68,78", "0,1,5,5"],
            ["01,0,58,68", "0,4,2,2"]
        ],
        prop: [
            null,
            [2, "x2", "+15", 0],
            [0, 0, 0, "325"],
            [1, 2, 1, 1],
            [2, "+15", "-10", 0],
            [1, 3, 2, 1],
            [2, "x2", "+25", 0],
            null,
            [1, 2, 1, 1],
            [2, "-10", "+15", 0],
            null,
            [0, 0, 0, "524"],
            [2, "-10", "x2", 0],
            null
        ]
    },
    14: {
        //关卡
        lv: 14,
        //路段配置
        path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P004R', 'P001R', 'P003RB', 'P999',],
 

        //敌人
        // ['触发点Id, 敌人类型id, 最小数量, 最大数量 ']
        enemy: [
            ['012,0,65,65', '012,4,2,2'],
            ['012,0,45,45'],
            ['012,0,55,65', '012,4,6,6'],
            ['012,0,45,65'],
            ['012,0,40,65', '012,1,2,6'],
            ['012,0,40,65'],
            ['012,0,50,55', '012,2,4,4'],
            ['012,0,50,55'],
            ['012,0,45,45'],
            ['012,0,50,55', '012,4,3,5'],
            ['012,0,65,65'],
            ['012,0,70,75', '012,4,3,5'],
            ['012,0,55,55'],
            null,

        ],
        /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
        prop: [
            null,
            [0, 0, 0, '3'], // 需改人数配置  左2
            [2, '-3', '+10', 0],
            [1, 0, 1, 0],
            [2, 'x1', '-5', 0],
            [1, 0, 1, 1], //改圆柱
            [2, '+10', '+15', 0],
            [2, '+4', '+5', 0],// 需改人数配置  左4 右4
            [0, 0, 0, '5'],
            [1, 0, 1, 1],
            null,
            [2, 'x2', '+15', 0],
            [1, 0, 1, 1], //改移动圆柱
            null,
        ],
    },
    15:
    {
        lv: 15,
        path: ["P000", "P001", "P003", "P003", "P003L", "P001L", "P001L", "P002LB", "P001", "P002R", "P001R", "P001R", "P002RB", "P999"],
        enemy: [
            ["0,0,58,68", "0,4,2,2"],
            ["0,0,38,48", "0,4,2,2"],
            ["012,0,38,48", "0,4,2,4"],
            ["012,0,38,48", "01,1,4,6"],
            ["012,0,38,48", "012,3,2,6"],
            ["012,0,38,48", "0,4,4,6"],
            ["012,0,38,48", "0,4,2,6"],
            ["012,0,38,48", "0,1,3,6"],
            ["012,0,38,48", "0,2,1,6"],
            ["012,0,38,48"],
            ["012,0,58,58", "0,1,4,6"],
            ["012,0,68,68", "0,2,4,6"],
            ["012,0,68,78", "0,3,5,8"],
        ],
        prop: [
            null,
            [2, "x2", "+10", 0],
            [1, 2, 1, 1],
            [2, "x2", "+25", 0],
            [0, 0, 0, "453"],
            [1, 1, 1, 1],
            [2, "+10", "-20", 0],
            [0, 0, 0, "234"],
            [2, "-15", "-3", 0],
            null,
            [1, 6, 3, 0],
            [0, 0, 0, "52"],
            [2, "-12", "+15", 0],
            [1, 3, 3, 0],
        ]
    },
    // 16:
    // {
    //     lv: 16,
    //     path: ["P000", "P001", "P003", "P004L", "P001L", "P001L", "P003LB", "P003", "P003", "P003", "P004R", "P001R", "P001R", "P001R", "P003RB", "P999"],
    //     enemy: [
    //         ["0,0,58,68", "0,4,2,2"],
    //         ["0,0,48,48", "0,4,2,2"],
    //         ["01,0,48,48", "0,4,2,2"],
    //         ["01,0,48,48", "01,1,2,2"],
    //         ["012,0,38,48", "012,3,2,2"],
    //         ["012,0,38,48", "0,4,2,2"],
    //         ["012,0,38,48", "0,4,2,3"],
    //         ["012,0,38,48", "0,1,2,3"],
    //         ["012,0,48,48", "0,1,2,3"],
    //         ["012,0,48,48"],
    //         ["012,0,48,48", "0,4,2,5"],
    //         ["012,0,48,48", "0,4,2,5"],
    //         ["012,0,48,58", "0,1,3,5"],
    //         ["01,0,58,68", "0,2,2,4"],
    //         ["01,0,68,78", "0,1,5,5"],
    //         ["01,0,58,68", "0,4,2,2"]
    //     ],
    //     prop: [
    //         null,
    //         [2, "x3", "+25", 0],
    //         [0, 0, 0, "325"],
    //         [1, 2, 1, 1],
    //         [2, "-10", "x2", 0],
    //         [1, 3, 2, 1],
    //         [2, "+15", "-10", 0],
    //         null,
    //         [1, 2, 1, 1],
    //         [2, "x2", "+25", 0],
    //         [0, 0, 0, "524"],
    //         [2, "-10", "+15", 0],
    //         [1, 3, 2, 1],
    //         null
    //     ]
    // },
    // 17:
    // {
    //     lv: 17,
    //     path: ["P000", "P003", "P003", "P001", "P004L", "P001L", "P001L", "P001L", "P002LB", "P001", "P003L", "P001L", "P001L", "P004LB", "P999"],
    //     enemy: [
    //         ["0,0,58,68", "0,4,2,2"],
    //         ["0,0,38,48", "0,4,2,2"],
    //         ["0,0,38,48", "0,4,2,2"],
    //         ["01,0,38,48", "01,1,2,2"],
    //         null,
    //         ["012,0,28,58", "012,3,2,2"],
    //         ["0,0,48,48", "0,2,2,2"],
    //         ["0,0,48,48", "0,4,5,5"],
    //         ["0,0,48,48", "0,2,4,4"],
    //         ["0,0,48,48", "0,1,5,5"],
    //         ["0,0,38,48"],
    //         ["0,0,48,48", "0,2,5,5"],
    //         ["0,0,58,68", "0,4,4,5"],
    //         ["0,0,58,58", "0,1,3,5"],
    //         ["0,0,58,58", "0,2,2,6"],
    //         ["0,0,68,68", "0,1,5,6"],
    //         ["0,0,50,50", "0,4,2,6"]
    //     ],
    //     prop: [
    //         null,
    //         [2, "x2", "+40", 0],
    //         [1, 2, 1, 1],
    //         [0, 0, 0, "324"],
    //         [2, "+25", "+30", 0],
    //         [1, 3, 2, 1],
    //         [2, "-5", "-15", 0],
    //         null,
    //         [1, 2, 1, 1],
    //         [2, "x2", "+25", 0],
    //         [0, 0, 0, "214"],
    //         [2, "-10", "+15", 0],
    //         [1, 3, 1, 1],
    //         [2, "-15", "+15", 0],
    //     ]
    // },
    // 18:
    // {
    //     lv: 18,
    //     path: ["P000", "P001", "P003", "P003", "P003L", "P001L", "P001L", "P002LB", "P001", "P002R", "P001R", "P001R", "P002RB", "P999"],
    //     enemy: [
    //         ["0,0,58,68", "0,4,2,2"],
    //         ["0,0,38,48", "0,4,2,2"],
    //         ["0,0,38,48", "0,4,2,2"],
    //         ["01,0,38,48", "01,1,2,2"],
    //         ["012,0,38,48", "012,3,2,2"],
    //         ["0,0,38,48", "0,4,2,2"],
    //         ["0,0,38,48", "0,4,2,2"],
    //         ["0,0,38,48", "0,1,2,2"],
    //         ["0,0,38,48", "0,1,2,2"],
    //         ["0,0,38,48"],
    //         ["0,0,58,58", "0,1,3,3"],
    //         ["0,0,68,68", "0,2,2,3"],
    //         ["0,0,68,78", "0,1,5,5"],
    //     ],
    //     prop: [
    //         null,
    //         [2, "x3", "+32", 0],
    //         [1, 2, 1, 1],
    //         [2, "/2", "-10", 0],
    //         [0, 0, 0, "453"],
    //         [1, 1, 1, 1],
    //         [2, "+14", "-20", 0],
    //         [0, 0, 0, "234"],
    //         [2, "-17", "x3", 0],
    //         null,
    //         [1, 6, 3, 0],
    //         [0, 0, 0, "52"],
    //         [2, "-11", "+15", 0],
    //         [1, 3, 3, 0],
    //     ]
    // },
    // 19: {
    //     //关卡
    //     lv: 19,
    //     //路段配置
    //     path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P001', 'P004R', 'P001R', 'P003RB', 'P999',],
 

    //     //敌人
    //     // ['触发点Id, 敌人类型id, 最小数量, 最大数量 ']
    //     enemy: [
    //         ['012,0,65,65', '012,4,2,2'],
    //         ['012,0,45,45'],
    //         ['012,0,55,65', '012,4,6,6'],
    //         ['012,0,45,65'],
    //         ['012,0,40,65', '012,1,2,6'],
    //         ['012,0,40,65'],
    //         ['012,0,50,55', '012,2,4,4'],
    //         ['012,0,50,55'],
    //         ['012,0,45,45'],
    //         ['012,0,50,55', '012,4,3,5'],
    //         ['012,0,65,65'],
    //         ['012,0,70,75', '012,4,3,5'],
    //         ['012,0,55,55'],
    //         null,

    //     ],
    //     /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
    //     prop: [
    //         null,
    //         [0, 0, 0, '3'], // 需改人数配置  左2
    //         [2, '-8', '+20', 0],
    //         [1, 0, 1, 0],
    //         [2, 'x2', '+10', 0],
    //         [1, 0, 1, 1], //改圆柱
    //         [2, '+10', '+15', 0],
    //         [2, '+4', '+8', 0],// 需改人数配置  左4 右4
    //         [0, 0, 0, '5'],
    //         [1, 0, 1, 1],
    //         null,
    //         [2, 'x2', '+15', 0],
    //         [1, 0, 1, 1], //改移动圆柱
    //         null,
    //     ],
    // },
    // 20:
    // {
    //     lv: 20,
    //     path: ["P000", "P001", "P003", "P004L", "P001L", "P001L", "P003LB", "P003", "P003", "P003", "P004R", "P001R", "P001R", "P001R", "P003RB", "P999"],
    //     enemy: [
    //         ["0,0,58,68", "0,4,2,2"],
    //         ["0,0,48,48", "0,4,2,2"],
    //         ["01,0,48,48", "0,4,2,2"],
    //         ["01,0,48,48", "01,1,2,2"],
    //         ["012,0,48,48", "012,3,2,2"],
    //         ["012,0,48,48", "0,4,2,2"],
    //         ["012,0,48,48", "0,4,2,2"],
    //         ["012,0,38,48", "0,1,2,2"],
    //         ["012,0,48,48", "0,1,2,2"],
    //         ["012,0,48,48"],
    //         ["012,0,38,48", "0,4,2,2"],
    //         ["012,0,48,48", "0,4,2,2"],
    //         ["012,0,48,58", "0,1,3,3"],
    //         ["01,0,88,88", "0,2,2,3"],
    //         ["01,0,68,78", "0,1,5,5"],
    //         ["01,0,58,68", "0,4,2,2"]
    //     ],
    //     prop: [
    //         null,
    //         [2, "x2", "+10", 0],
    //         [0, 0, 0, "325"],
    //         [1, 2, 1, 1],
    //         [2, "+15", "-10", 0],
    //         [1, 3, 2, 1],
    //         [2, "x2", "+25", 0],
    //         null,
    //         [1, 2, 1, 1],
    //         [2, "-10", "+15", 0],
    //         null,
    //         [0, 0, 0, "524"],
    //         [2, "-10", "x2", 0],
    //         null
    //     ]
    // },
    // 21: {
    //     //关卡
    //     lv: 5,
    //     //路段配置
    //     path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P004L', 'P001L', 'P001L', 'P004LB', 'P001', 'P001', 'P999',],
    //     // path: ['P000',  'P999'],

    //     //敌人
    //     /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
    //     enemy: [
    //         ['012,0,65,75', '012,3,3,3'],
    //         ['012,0,55,55'],
    //         ['012,0,35,35', '012,3,4,4'],
    //         ['012,0,35,35'],
    //         ['012,0,30,35', '012,3,4,6'],
    //         ['012,0,30,35'],
    //         ['012,0,30,35', '012,3,4,4'],
    //         ['012,0,30,35'],
    //         ['012,0,55,65', '012,3,4,4'],
    //         ['012,0,50,55'],
    //         ['012,0,65,65', '012,1,4,4'],
    //         ['012,0,70,75'],
    //         null,
    //     ],
    //     /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
    //     prop: [
    //         null,
    //         [2, '+20', 'x3', 0],
    //         [2, 0, '+6', 0], //改白人中间6个
    //         [1, 0, 1, 1], //改左右圆柱2个
    //         [0, 0, 0, '1'],
    //         [2, '+10', '+5', 0],
    //         [1, 0, 1, 1],
    //         [2, '-5', '-15', 0],
    //         [1, 3, 1, 0],
    //         [2, '+20', 'x2', 0],
    //         [1, 0, 0, '4'],
    //         null,
    //     ],
    // },
    // 22: {
    //     //关卡
    //     lv: 22,
    //     //路段配置
    //     path: ['P000', 'P001', 'P001', 'P001', 'P001', 'P001', 'P004L', 'P001L', 'P001L', 'P001L', 'P004LB', 'P001', 'P001', 'P999',],
    //     // path: ['P000',  'P999'],

    //     //敌人
    //     /**pathId:创建路径id : (012:随机多条 0~5:多条路径id, 012:全部), type: 敌人类型, min:最少,max：最大 */
    //     enemy: [
    //         ['012,0,75,75', '012,3,3,3'],
    //         ['012,0,65,65'],
    //         ['012,0,45,45', '012,3,4,4'],
    //         ['012,0,45,45'],
    //         ['012,0,40,45', '012,3,5,5'],
    //         ['012,0,50,55'],
    //         ['012,0,40,55', '012,3,4,4'],
    //         ['012,0,50,55'],
    //         ['012,0,45,45', '012,1,2,2'],
    //         ['012,0,60,65'],
    //         ['012,0,65,65', '012,1,4,4'],
    //         ['012,0,60,75', '012,1,4,4'],
    //         ['012,0,65,75', '012,1,5,5'],
    //         ['012,0,75,75', '012,1,2,2'],
    //     ],
    //     /** 道具类型:(0-武器,1-陷阱,2-人数),   道具具体分类,  道具数量 , 道具配置参数*/
    //     prop: [
    //         null,
    //         [2, 'x2', '+15', 0],
    //         [1, 0, 1, 1],
    //         [0, 0, 0, '12'],
    //         [2, '+10', 'x2', 0],
    //         [1, 0, 1, 1],
    //         null,
    //         [1, 0, 1, 0],
    //         [2, '+5', '+15', 0],
    //         [1, 3, 1, 0],
    //         [0, 0, 0, '234'],
    //         null,
    //         [2, '+25', '+15', 0],
    //         [1, 5, 1, 0], //改圆柱1个
    //         null,
    //     ],
    // },
}
